#include<iostream>
#include<fstream>
#include<string>
using namespace std;

int main (int argc, char** argv)
{
	string filename, cmd;
	filename = string(argv[0]) + ".txt";

	for (int i = 0; i < argc; i++)
			cmd += argv[i] + ' ';

    ofstream f(filename.c_str() , ios::out | ios::app);
    if (f.is_open())
	{
		f << cmd << endl;
		f.close();
	}
	cmd = "exec" + cmd;
	system("PAUSE");
	system(cmd.c_str());

    return 0;
};
